<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

    /**
     * Constructor de la clase makinita.
     * @param array $entrada
     * @param array $reglas
     * @return boolean $error
     */

     
abstract class sfTdBase extends sfTableWidget {
    
    abstract public function isModelTd();
    
    public function render($content) {
        if($content=='')$content=$this->getDefault();        
        if(($link = $this->getOption('link')) != '')
            $result = $this->renderContentTag('td', 
                        //$this->renderContentTag('div', 
                                $this->renderContentTag('a',
                                        strtr($this->getOption('template'),  array_merge($this->parent->trans,array('%content%'=>$content)))
                                        ,array('href'=>strtr($link,$this->parent->trans))), array_merge($this->getAttributes(),$this->parent->getOption('defaultTdAttributes')));        
        else
            $result = $this->renderContentTag('td',
                                    strtr($this->getOption('template'),  array_merge($this->parent->trans,array('%content%'=>$content)))
                                    ,array_merge($this->getAttributes(),$this->parent->getOption('defaultTdAttributes')));
       
        return $result;
    }

}
?>
